#include <iostream>
#include "px4_flight_handler.h"


using namespace std;


int main(int argc, char **argv)
{
	cout << "px control module." << endl;

	bool ret;

	ret = flightHandler.startUpSystem("udp");
	if(!ret)
	{
		cout << " startUp system error!!!" << endl;
		return -1;
	}

	cout << "startUp system ok" << endl;
	flightHandler.writeLogFile("startUp system ok\n");

	while(1)
	{
		sleepMs(1000);

		//write the cpu temperature to log
		flightHandler.recodeCpuTemperature();

		//fflush log file
		flightHandler.fflushLogFile();
	}

	return 0;
}


